Skip to content

[pull] master from glideapps:master#69

Merged
pull[bot] merged 11 commits into
meonBot:masterfrom
glideapps:master
Jul 19, 2026
Merged

[pull] master from glideapps:master#69
pull[bot] merged 11 commits into
meonBot:masterfrom
glideapps:master

Conversation

@pull

@pull pull Bot commented Jul 19, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

AysajanE and others added 11 commits July 16, 2026 12:55
Signed-off-by: Aysajan Eziz <aeziz@northset.ai>
The previous commit only applied the output-filename-derived module name
to the TypeScript usage import comment; JavaScript (and Flow, which
inherits it) still emitted require("./file"). Hoist the module-name
derivation into a shared usageModuleName helper on JavaScriptRenderer,
use it in both the JavaScript require comment and the TypeScript import
comment, and extend the unit test to cover JavaScript, Flow, and the
stdout fallback.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
fix: use output filename in TypeScript usage imports
JSON Schema draft 2020-12 renamed the array (tuple) form of `items` to
`prefixItems`, which is now emitted by Pydantic v2 and Rust's schemars.
`makeArrayType()` only read `schema.items`, so a `prefixItems`-based tuple
fell through to the generic `any[]` branch and lost its member types; with
`--just-types` and a top-level array that produced no output at all.
`prefixItems` was also missing from the `needUnion` type-inference predicate.

Apply the existing array-form `items` tuple-union logic to `schema.prefixItems`
as well, and add `prefixItems` to the type-inference predicate. When
`prefixItems` is absent, array handling is unchanged.

Adds test/unit/prefix-items-schema.test.ts, which fails before this change and
passes after.

Fixes #2811
Two follow-ups to the prefixItems tuple support:

- In 2020-12, an object-form `items` next to `prefixItems` describes the
  rest elements of an open tuple. It was previously dropped; now its type
  joins the tuple's element union (quicktype models tuples as arrays of a
  union of the member types). Boolean `items` (`false` closes the tuple,
  `true` allows anything) is still ignored.

- Add `test/inputs/schema/prefix-items.schema` so the feature is covered
  by the end-to-end fixture tests, mirroring `tuple.schema` but with
  2020-12 `prefixItems`, plus an open tuple that also has a rest `items`
  schema. The `.fail.union.json` sample has a tuple element outside the
  declared union, so validating languages must reject it — it would be
  accepted if the tuple degraded to `any[]`, which is exactly the
  regression this guards against.

The unit test keeps only what fixtures cannot express (that `$ref`d
member types survive into the generated code) and gains a case for the
prefixItems-plus-rest-items union.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The generated cJSON deserializer silently drops array elements whose type
is outside the union instead of aborting parsing, so the
prefix-items.1.fail.union.json expected-failure sample does not fail.
This is the already-documented "Union, Map and Arrays with invalid types
are not checked" limitation; add the schema to that skip group.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Both test drivers exit 0 on a failed decode (scala3 prints the circe
DecodingFailure, haskell encodes the Maybe result as null), so the
prefix-items.1.fail.union.json expected-failure sample cannot be
detected. Same documented limitation as nested-intersection-union.schema.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…chema

Handle JSON Schema 2020-12 prefixItems tuples
The badge pointed at the deleted master.yaml workflow (and the old
quicktype/quicktype repo path); point it at test-pr.yaml on master
and make it link to the workflow runs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The kotlinx framework of the Kotlin renderer had no end-to-end fixture
coverage at all — only klaxon (kotlin/schema-kotlin) and jackson
(kotlin-jackson/schema-kotlin-jackson) were tested.

This adds kotlinx and schema-kotlinx fixtures:

- test/fixtures/kotlinx/: driver that round-trips JSON through the
  generated @serializable types with kotlinx-serialization-json (runtime
  jars vendored like the klaxon/jackson jars; the compiler plugin ships
  with the Kotlin distribution).
- KotlinXLanguage entry in test/languages.ts with skips for what the
  kotlinx renderer genuinely cannot do yet, all verified by compiling
  and round-tripping every input locally:
  - unions render as sealed classes with no serializer wiring
    (documented TODO in KotlinXRenderer.ts), so union inputs are
    skipped and the "union" feature is not claimed;
  - top-level arrays render as `typealias TopLevel = JsonArray<T>`,
    which does not compile;
  - astral-plane characters in property names are emitted as 5-hex-digit
    \u escapes in @SerialName, which Kotlin misparses.
- CI matrix entry kotlinx,schema-kotlinx on the 16-core runner.

Compared to the klaxon fixtures this also enables inputs klaxon cannot
handle: simple-identifiers.json, no-classes.json, bug427.json, and the
any, uuid, keyword-enum, top-level-enum, top-level-primitive,
nested-intersection-union, and go-schema-pattern-properties schemas.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add fixture coverage for Kotlin kotlinx-serialization
@pull pull Bot locked and limited conversation to collaborators Jul 19, 2026
@pull pull Bot added the ⤵️ pull label Jul 19, 2026
@pull
pull Bot merged commit 1ba5a25 into meonBot:master Jul 19, 2026
1 check failed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants